package com.ruoyi.system.domain.bo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 系统异常时间登录记录业务对象 sys_login_record
 *
 * @author ruoyi
 * @date 2023-11-30
 */

@Data
public class SysLoginRecordBo {

    /**
     * 访问ID
     */
    @NotNull(message = "访问ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 用户ID
     */
    //@NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long userId;

    /**
     * 用户账号
     */
    //@NotBlank(message = "用户账号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String userName;

    /**
     * 登录IP地址
     */
    //@NotBlank(message = "登录IP地址不能为空", groups = { AddGroup.class, EditGroup.class })
    private String ipaddr;

    /**
     * 登录地点
     */
    //@NotBlank(message = "登录地点不能为空", groups = { AddGroup.class, EditGroup.class })
    private String loginLocation;

    /**
     * 浏览器类型
     */
    //@NotBlank(message = "浏览器类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String browser;

    /**
     * 操作系统
     */
    //@NotBlank(message = "操作系统不能为空", groups = { AddGroup.class, EditGroup.class })
    private String os;

    /**
     * 登录状态（0成功 1失败）
     */
    //@NotBlank(message = "登录状态（0成功 1失败）不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;

    /**
     * 提示消息
     */
    //@NotBlank(message = "提示消息不能为空", groups = { AddGroup.class, EditGroup.class })
    private String msg;

    /**
     * 登录时间
     */
    //@NotNull(message = "登录时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date loginTime;

    /**
     * 时间规则
     */
    //@NotBlank(message = "时间规则不能为空", groups = { AddGroup.class, EditGroup.class })
    private String timeRule;

    private Long parentId;

    /**
     * 请求参数
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();

}
